package com.cy.air.postXml.controller
{
	import com.cy.air.postXml.model.RequestUrlProxy;
	import com.cy.air.postXml.model.XmlRequestProxy;
	import com.cy.air.postXml.view.RequestUrlMediator;
	
	import org.puremvc.as3.interfaces.ICommand;
	import org.puremvc.as3.interfaces.INotification;
	import org.puremvc.as3.patterns.command.SimpleCommand;

	public class PostXmlCommand  extends SimpleCommand implements ICommand
	{
		override public function execute(notification:INotification):void
		{
			var xmlproxy:XmlRequestProxy=facade.retrieveProxy(XmlRequestProxy.NAME) as XmlRequestProxy;
			var urlproxy:RequestUrlProxy=facade.retrieveProxy(RequestUrlProxy.NAME) as RequestUrlProxy;
			
			
//			var requesturlmediator:RequestUrlMediator=facade.retrieveMediator(RequestUrlMediator.NAME) as RequestUrlMediator;
//			urlproxy.requesturl=requesturlmediator.requestUrlView.requestUrl;
			
			xmlproxy.requestText=notification.getBody() as String;
			xmlproxy.requesturl=urlproxy.requesturl;
			
			xmlproxy.sendXml();
		}
	}
}